<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
        <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<script type="text/javascript" src="${initParam.root }smarteditor/js/HuskyEZCreator.js" charset="utf-8"></script>
<script>
$(function(){
	 var oEditors = [];
	 nhn.husky.EZCreator.createInIFrame({
	 htParams :{ 
               fOnBeforeUnload : function(){ 
                  //alert(&quot;onbeforeunload call&quot;);	
             }}, 
	 oAppRef: oEditors,
	 elPlaceHolder: "content", //textarea에서 지정한 id와 일치해야 합니다.
	 sSkinURI: "${initParam.root}smarteditor/SmartEditor2Skin.html",
	 fCreator: "createSEditor2"
	 
	 });
	 $("#ok").click(function(){
			//alert($("#content").text());
			oEditors.getById["content"].exec("UPDATE_CONTENTS_FIELD", []);
			//$("#submitForm").submit();
			if($("#content").val()==""){
				alert("내용을 입력하세요");
				return false;
			}else{
				$("#submitForm").submit();
			}
	});	
	 /* $("#ok").click(function(){
			if($("#content").val()==""){
				alert("내용을 입력하세요");
				return false;
			}
			
	}); */
	
	var count=$("#content").val().length;
	$("#letterCount").html(count); 
	
	$("#cancel").click(function(){
		if(confirm("수정을 취소하시겠습니까?")){
			location.href="${initParam.root}collection/auth_detailCollectionNoHit.do?no=${requestScope.bvo.no}";
		}
	});
});
</script>
<form action="${initParam.root }collection/auth_replyWriteGo.do" method="post"  enctype="multipart/form-data" id="submitForm">
	<input type="hidden" name="ref" value="${requestScope.bvo.ref}">
	<input type="hidden" name="restep" value="${requestScope.bvo.restep}">
	<input type="hidden" name="relevel" value="${requestScope.bvo.relevel}">
	<input type="hidden" name="no" value="${requestScope.bvo.no}">
	<input type="hidden" name="title" value="${requestScope.bvo.title}" id="title">
	<table>
	<tr><td>No</td><td> ${requestScope.bvo.no}</td></tr>
	<tr><td>Title</td><td>Re: ${requestScope.bvo.title}</td></tr>
	<tr><td>Content</td></tr>
	</table>
	<pre><textarea rows="15" cols="40" name="content" id="content">${requestScope.bvo.content }</textarea></pre>
	<p align="right" style="padding-right: 30px;">
	<input type="button" name="cancel" id="cancel" value="취소">
	<input type="button" value="확인" id="ok">
	</p>
</form>











